GoXam for WPF v3
Load<NodeDataType>(XContainer,Func<XElement,NodeDataType>) Method
Northwoods.GoXam.Model Namespace > GraphModel<NodeType,NodeKey> Class > Load Method : Load<NodeDataType>(XContainer,Func<XElement,NodeDataType>) Method
this must be a class inheriting from GraphModelNodeData<NodeKey>
the XContainer holding all of the data
a function that takes an XElement and returns either a newly constructed object of type NodeDataType or null if that XElement is to be ignored
Given a Linq for XML XContainer holding node data, replace this model's NodesSource collection with a collection of new node data.
Syntax

Parameters

root
the XContainer holding all of the data
nodedataallocator
a function that takes an XElement and returns either a newly constructed object of type NodeDataType or null if that XElement is to be ignored

Type Parameters

NodeDataType
this must be a class inheriting from GraphModelNodeData<NodeKey>
Remarks

This will iterate over all of the child elements of the root container, calling nodedataallocator on each one. If that function returns non-null, it calls LoadFromXElement on the new data and then adds it to the NodesSource collection.

All of the changes to this model are performed within a transaction.

This does not set the IsModified property to false. You may wish to do so, depending on your application requirements. You might also wish to clear the UndoManager.

See Also

Reference

GraphModel<NodeType,NodeKey> Class
GraphModel<NodeType,NodeKey> Members
Overload List